(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[     12418,        350]
NotebookOptionsPosition[     12009,        333]
NotebookOutlinePosition[     12348,        348]
CellTagsIndexPosition[     12305,        345]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[{
 RowBox[{
  RowBox[{"fun", "[", 
   RowBox[{"d_", ",", "x_"}], "]"}], ":=", 
  RowBox[{
   RowBox[{
    RowBox[{"(", 
     RowBox[{"x", "-", "0.5"}], ")"}], "^", "d"}], "+", 
   RowBox[{"3", "*", "x"}]}]}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "1"}], ",", 
   RowBox[{"i", "<", "25"}], ",", 
   RowBox[{
    RowBox[{"i", "++"}], ";", 
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"fun", "[", 
        RowBox[{"i", ",", "r"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}]}]}], 
  "]"}]}], "Input",
 CellChangeTimes->{{3.552837855489203*^9, 3.5528379410560713`*^9}, {
  3.552837989452104*^9, 3.552837995600285*^9}, {3.552838159198038*^9, 
  3.552838168746395*^9}, {3.552844330266018*^9, 3.552844362101963*^9}, {
  3.552844466541844*^9, 3.552844467789237*^9}, {3.552845347581991*^9, 
  3.552845348061347*^9}, {3.552845445201139*^9, 3.5528454468952417`*^9}, {
  3.552846013481695*^9, 3.552846014103981*^9}, {3.55284610577382*^9, 
  3.5528461979831133`*^9}, {3.552846245386366*^9, 3.552846313535491*^9}, {
  3.552846359395516*^9, 3.5528463720537024`*^9}, {3.552846404219952*^9, 
  3.552846531914764*^9}, {3.552846651498234*^9, 3.552846689042309*^9}, {
  3.552848161180397*^9, 3.552848249025999*^9}, {3.5528516655773287`*^9, 
  3.552851670568582*^9}}],

Cell[BoxData[{
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{"fun", "[", 
    RowBox[{"2", ",", "x"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{"fun", "[", 
    RowBox[{"3", ",", "x"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{"fun", "[", 
    RowBox[{"5", ",", "x"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{"fun", "[", 
    RowBox[{"6", ",", "x"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.552900769291792*^9, 3.552900841000463*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"funxy", "[", 
   RowBox[{"d_", ",", "x_", ",", "y_"}], "]"}], ":=", 
  RowBox[{
   RowBox[{
    RowBox[{"(", 
     RowBox[{"x", "-", "0.5"}], ")"}], "^", "d"}], "+", 
   RowBox[{"y", "^", "d"}], "+", 
   RowBox[{"3", "*", "x", "*", "y"}]}]}], "\[IndentingNewLine]", 
 RowBox[{"Print", "[", "\"\<Quad\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "2"}], ",", 
   RowBox[{"i", "<", "12"}], ",", 
   RowBox[{
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"funxy", "[", 
        RowBox[{"i", ",", "r", ",", "s"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"s", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}], ";", 
    RowBox[{"i", "++"}]}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Print", "[", "\"\<Triangle\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "2"}], ",", 
   RowBox[{"i", "<", "12"}], ",", 
   RowBox[{
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"funxy", "[", 
        RowBox[{"i", ",", "r", ",", "s"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", "0", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"s", ",", "0", ",", 
         RowBox[{"1", "-", "r"}]}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}], ";", 
    RowBox[{"i", "++"}]}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.552837855489203*^9, 3.5528379410560713`*^9}, {
  3.552837989452104*^9, 3.552837995600285*^9}, {3.552838108334023*^9, 
  3.552838144577673*^9}, {3.552844453633876*^9, 3.552844499115725*^9}, {
  3.552845224349523*^9, 3.5528452249401283`*^9}, {3.5528484858745527`*^9, 
  3.552848583830464*^9}, {3.5528486284997587`*^9, 3.552848630627668*^9}, {
  3.552851478268166*^9, 3.552851485845153*^9}, {3.552851580567727*^9, 
  3.5528516574513807`*^9}}],

Cell[BoxData[{
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"2", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"3", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"5", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Plot3D", "[", 
   RowBox[{
    RowBox[{"funxy", "[", 
     RowBox[{"6", ",", "x", ",", "y"}], "]"}], ",", 
    RowBox[{"{", 
     RowBox[{"x", ",", 
      RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"y", ",", 
      RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"2", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", "0", ",", 
     RowBox[{"1", "-", "x"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"3", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", "0", ",", 
     RowBox[{"1", "-", "x"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"5", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", "0", ",", 
     RowBox[{"1", "-", "x"}]}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Plot3D", "[", 
  RowBox[{
   RowBox[{"funxy", "[", 
    RowBox[{"6", ",", "x", ",", "y"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"y", ",", "0", ",", 
     RowBox[{"1", "-", "x"}]}], "}"}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.5529004512060633`*^9, 3.552900558808462*^9}, {
   3.552900877533557*^9, 3.5529009103759537`*^9}, 3.5529009963535233`*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"funxyz", "[", 
   RowBox[{"d_", ",", "x_", ",", "y_", ",", "z_"}], "]"}], ":=", 
  RowBox[{
   RowBox[{
    RowBox[{"(", 
     RowBox[{"x", "-", "0.5"}], ")"}], "^", "d"}], "+", 
   RowBox[{"y", "^", "d"}], "+", 
   RowBox[{"z", "^", "d"}], "+", 
   RowBox[{"3", "*", "x", "*", "y", "*", "z"}]}]}], "\[IndentingNewLine]", 
 RowBox[{"Print", "[", "\"\<Tetrahedra\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "2"}], ",", 
   RowBox[{"i", "<", "12"}], ",", 
   RowBox[{
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"funxyz", "[", 
        RowBox[{"i", ",", "r", ",", "s", ",", "t"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", "0", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"s", ",", "0", ",", 
         RowBox[{"1", "-", "r"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"t", ",", "0", ",", 
         RowBox[{"1", "-", "r", "-", "s"}]}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}], ";", 
    RowBox[{"i", "++"}]}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Print", "[", "\"\<Pyramid\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "2"}], ",", 
   RowBox[{"i", "<", "12"}], ",", 
   RowBox[{
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"funxyz", "[", 
        RowBox[{"i", ",", "r", ",", "s", ",", "t"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"t", ",", "0", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", 
         RowBox[{"t", "-", "1"}], ",", 
         RowBox[{"1", "-", "t"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"s", ",", 
         RowBox[{"t", "-", "1"}], ",", 
         RowBox[{"1", "-", "t"}]}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}], ";", 
    RowBox[{"i", "++"}]}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Print", "[", "\"\<Prisma\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "2"}], ",", 
   RowBox[{"i", "<", "12"}], ",", 
   RowBox[{
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"funxyz", "[", 
        RowBox[{"i", ",", "r", ",", "s", ",", "t"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", "0", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"s", ",", "0", ",", 
         RowBox[{"1", "-", "r"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"t", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}], ";", 
    RowBox[{"i", "++"}]}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Print", "[", "\"\<Hexahedra\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{"For", "[", 
  RowBox[{
   RowBox[{"i", "=", "2"}], ",", 
   RowBox[{"i", "<", "12"}], ",", 
   RowBox[{
    RowBox[{"Print", "[", 
     RowBox[{"NIntegrate", "[", 
      RowBox[{
       RowBox[{"funxyz", "[", 
        RowBox[{"i", ",", "r", ",", "s", ",", "t"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"r", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"s", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"t", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"WorkingPrecision", "\[Rule]", "16"}]}], "]"}], "]"}], ";", 
    RowBox[{"i", "++"}]}]}], "]"}]}], "Input",
 CellChangeTimes->{{3.552837855489203*^9, 3.5528379410560713`*^9}, {
  3.552837989452104*^9, 3.552837995600285*^9}, {3.552838108334023*^9, 
  3.552838144577673*^9}, {3.552844453633876*^9, 3.552844499115725*^9}, {
  3.552845224349523*^9, 3.5528452249401283`*^9}, {3.5528484858745527`*^9, 
  3.5528485572719917`*^9}, {3.552848587622177*^9, 3.552848637723662*^9}, {
  3.552848704384523*^9, 3.552848705736368*^9}, {3.552851687368862*^9, 
  3.552851693576*^9}, {3.552851735500379*^9, 3.5528517700360518`*^9}, {
  3.5528518062871017`*^9, 3.552851898392296*^9}, {3.5528519389126167`*^9, 
  3.5528520118668423`*^9}, {3.55285372720582*^9, 3.55285375780724*^9}}]
},
WindowSize->{1129, 975},
WindowMargins->{{4, Automatic}, {Automatic, 4}},
FrontEndVersion->"7.0 for Mac OS X x86 (32-bit) (November 10, 2008)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 1485, 35, 43, "Input"],
Cell[2033, 57, 935, 29, 73, "Input"],
Cell[2971, 88, 2105, 53, 88, "Input"],
Cell[5079, 143, 2697, 80, 148, "Input"],
Cell[7779, 225, 4226, 106, 148, "Input"]
}
]
*)

(* End of internal cache information *)
